package com.lzy.huijinjiazu.mvp.ui.fragment;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.gyf.barlibrary.ImmersionBar;
import com.jess.arms.base.BaseFragment;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.jess.arms.widget.autolayout.AutoToolbar;
import com.lzy.huijinjiazu.R;
import com.lzy.huijinjiazu.di.component.DaggerIWantJoinComponent;
import com.lzy.huijinjiazu.di.module.IWantJoinModule;
import com.lzy.huijinjiazu.mvp.contract.IWantJoinContract;
import com.lzy.huijinjiazu.mvp.presenter.IWantJoinPresenter;
import com.lzy.huijinjiazu.mvp.ui.activity.JoinPaymentActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;


public class IWantJoinFragment extends BaseFragment<IWantJoinPresenter> implements IWantJoinContract.View {


    @BindView(R.id.toolbar)
    Toolbar mToolbar;

    public static IWantJoinFragment newInstance() {
        IWantJoinFragment fragment = new IWantJoinFragment();
        return fragment;
    }

    @Override
    public void setupFragmentComponent(AppComponent appComponent) {
        DaggerIWantJoinComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .iWantJoinModule(new IWantJoinModule(this))
                .build()
                .inject(this);
    }

    @Override
    public View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_iwant_join, container, false);
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        mToolbar.getBackground().setAlpha(0);
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.setTitleBarMarginTop(getActivity(), mToolbar);
    }

    @OnClick(R.id.tv_join)
    public void onViewClicked() {
        ArmsUtils.startActivity(JoinPaymentActivity.class);
    }
}
